package org.example.controller.user;

import org.example.dao.commom.Result;
import org.example.dao.commom.ResultCode;
import org.example.dao.entity.user.AuPermission;
import org.simpleframework.xml.Path;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
@CrossOrigin
public class PermissionController {


    //TODO 新增

    /**
     * 增加权限(管理)
     */
    @PostMapping("/insertPermission")
    public Result insertPermission(@RequestBody AuPermission uPermission)
    {
        String name = uPermission.getName();



        return new Result(ResultCode.SUCCESS,null);
    }

    //TODO 查询

    /**
     * 分页查询权限(管理)
     */
    @PostMapping("/selectPermissions/{start}/{limit}")
    public Result selectPermissions(@PathVariable("start") Integer start,
                                    @PathVariable("limit") Integer limit)
    {

        return new Result(ResultCode.SUCCESS,null);
    }

    /**
     * 根据用户查询权限
     */
    @PostMapping("/selectPermissionsByUser")
    public Result selectPermissionsByUser(@RequestBody Long userId)
    {

        return new Result(ResultCode.SUCCESS,null);
    }

    /**
     * 根据Id查询权限(管理)
     */
    @PostMapping("/selectPermissionById")
    public Result selectPermissionById(@RequestBody AuPermission auPermission)
    {
        Long id = auPermission.getId();

        return new Result(ResultCode.SUCCESS,null);
    }

    //TODO 更新

    /**
     * 更新权限(管理)
     */
    @PostMapping("/updatePermission")
    public Result updatePermission(@RequestBody AuPermission uPermission)
    {
        Long id = uPermission.getId();
        String name = uPermission.getName();

        return new Result(ResultCode.SUCCESS,null);
    }


    //TODO 删除

    /**
     * 删除权限(管理)
     */
    @PostMapping("/deletePermission")
    public Result deletePermission(AuPermission auPermission)
    {
        Long id = auPermission.getId();
        return new Result(ResultCode.SUCCESS,null);
    }

    /**
     * 批量删除权限(管理)
     */
    @PostMapping("/deletePermissionList")
    public Result deletePermissionList(List<String> id)
    {

        return new Result(ResultCode.SUCCESS,null);
    }




}
